#tag Class
Protected Class SouthIsOnTopState
Inherits TileState
Implements TileActions,SectionStates
	#tag Method, Flags = &h0
		Function GetNorthEastSlot() As Slot
		  // Part of the TileActions interface.
		  return baseTile.grid.GetSlot("sw")
		  
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetNorthWestSlot() As Slot
		  // Part of the TileActions interface.
		  return baseTile.grid.GetSlot("se")
		  
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetEastSlot() As Slot
		  // Part of the TileActions interface.
		  return baseTile.grid.GetSlot("w")
		  
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetSouthEastSlot() As Slot
		  // Part of the TileActions interface.
		  return baseTile.grid.GetSlot("nw")
		  
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetSouthSlot() As Slot
		  // Part of the TileActions interface.
		  return baseTile.grid.GetSlot("n")
		  
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetWestSlot() As Slot
		  // Part of the TileActions interface.
		  return baseTile.grid.GetSlot("e")
		  
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetSouthWestSlot() As Slot
		  // Part of the TileActions interface.
		  return baseTile.grid.GetSlot("ne")
		  
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetNorthSlot() As Slot
		  // Part of the TileActions interface.
		  return baseTile.grid.GetSlot("s")
		  
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetCentreSlot() As Slot
		  // Part of the TileActions interface.
		  return baseTile.grid.GetSlot("c")
		  
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Sub Constructor(tile as Tile)
		  baseTile = tile
		End Sub
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetWestSection() As TileSection
		  // Part of the SectionStates interface.
		  return baseTile.eastSection
		  
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetNorthSection() As TileSection
		  // Part of the SectionStates interface.
		  return baseTile.southSection
		  
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetSouthSection() As TileSection
		  // Part of the SectionStates interface.
		  return baseTile.northSection
		  
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetEastSection() As TileSection
		  // Part of the SectionStates interface.
		  return baseTile.westSection
		  
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetPicture() As Picture
		  return baseTile.southPicture
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetStreetConnections() As connections
		  dim con as Connections
		  
		  con.north = baseTile.StreetConnections.south
		  con.east = baseTile.StreetConnections.west
		  con.south = baseTile.StreetConnections.north
		  con.west = baseTile.StreetConnections.east
		  
		  return con
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function GetTownConnections() As connections
		  dim con as Connections
		  
		  con.north = baseTile.TownConnections.south
		  con.east = baseTile.TownConnections.west
		  con.south = baseTile.TownConnections.north
		  con.west = baseTile.TownConnections.east
		  
		  return con
		End Function
	#tag EndMethod

	#tag Method, Flags = &h0
		Function SlotWizard(pos as string) As string
		  select case pos
		  case "nw"
		    return "se"
		  case "n"
		    return "s"
		  case "ne"
		    return "sw"
		  case "w"
		    return "e"
		  case "c"
		    return "c"
		  case "e"
		    return "w"
		  case "sw"
		    return "ne"
		  case "s"
		    return "n"
		  case "se"
		    return "nw"
		  end select
		End Function
	#tag EndMethod


	#tag Property, Flags = &h0
		baseTile As Tile
	#tag EndProperty


	#tag ViewBehavior
		#tag ViewProperty
			Name="Name"
			Visible=true
			Group="ID"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Index"
			Visible=true
			Group="ID"
			InitialValue="-2147483648"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Super"
			Visible=true
			Group="ID"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Left"
			Visible=true
			Group="Position"
			InitialValue="0"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Top"
			Visible=true
			Group="Position"
			InitialValue="0"
			InheritedFrom="Object"
		#tag EndViewProperty
	#tag EndViewBehavior
End Class
#tag EndClass
